/*
 * cbuffer.h
 *
 *  Created on: 18.10.2009
 *      Author: fregat
 */

#ifndef CBUFFER_H_
#define CBUFFER_H_

typedef struct CBUFFER {
	unsigned char tail;
	unsigned char head;
	unsigned char size;
	unsigned char unit_size;
	void *buffer;

	void *(*read) (struct CBUFFER *cb);
	void (*write) (struct CBUFFER *cb, const void *pvalue);
} CBUFFER;

CBUFFER *cb (unsigned char sz, unsigned char unit_size);
void _cb (CBUFFER *pcb);

#endif /* CBUFFER_H_ */
